nyord-vpn

nyord-vpn is a simple NordVPN client for macOS users. It provides an easy way to manage VPN connections.

nyord-vpn is primarily designed for macOS, as it relies on OpenVPN, which is easily installable via Homebrew. However, with some modifications, it might be possible to use it on other platforms like Linux or Windows. Contributions to support additional platforms are welcome.

Key Features

Installation

To use nyord-vpn, you need to install some system requirements and the package itself.

System Requirements

Installing OpenVPN

Install OpenVPN using Homebrew:

brew install openvpn

Installing nyord-vpn

Install the package using pip:

pip install nyord-vpn

Configuration

Before using nyord-vpn, set your NordVPN credentials as environment variables:

export NORD_USER="your-username"
export NORD_PASSWORD="your-password"

Replace "your-username" and "your-password" with your actual NordVPN credentials.

Usage

nyord-vpn can be used via the command line interface (CLI) or programmatically through its Python API.

API Options

CLI Commands

Here are the available CLI commands:

Note: Some commands, such as connecting and disconnecting, may require sudo privileges. You might be prompted to enter your password.

Python API

You can use nyord-vpn programmatically in Python:

from nyord_vpn.core.factory import create_client

# Create a client (choose "legacy" or "njord")
client = create_client("legacy")

# Connect to VPN in a specific country
client.connect("netherlands")

# Check connection status
status = client.status()
print(f"Connected to {status['server']} ({status['ip']})")

# Disconnect from VPN
client.disconnect()

Ensure you have the necessary permissions to run OpenVPN when using the Python API.

Development

To contribute to nyord-vpn or modify the code:

  1. Install dependencies:

    pip install -r requirements.txt
  2. Install optional njord support:

    pip install njord
  3. Run with debug logging:

    NORD_USER="username" NORD_PASSWORD="password" nyord-vpn --verbose connect

For a full development setup, clone the repository, create a virtual environment, and install the package in editable mode:

git clone https://github.com/yourusername/nyord-vpn.git
cd nyord-vpn
python -m venv venv
source venv/bin/activate
pip install -e .

Replace yourusername with the actual repository owner.

Error Handling and Troubleshooting

nyord-vpn provides clear error messages to help resolve issues. Common errors include:

Troubleshooting Tips

Security Considerations

Contributing

We welcome contributions to nyord-vpn! To contribute:

  1. Fork the repository.
  2. Create a feature branch for your changes.
  3. Make your changes and commit them.
  4. Submit a pull request with a clear description of your changes.

For issues or questions, open an issue on the GitHub repository.

License

nyord-vpn is licensed under the MIT License. See the LICENSE file for details.